Imports System.Net.Mail

Partial Public Class ContactForm
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        'Create an instance of the MailMessage class
        Dim objMM As New MailMessage()
        objMM.To.Add("youreply@yourhost.com")
        objMM.Priority = MailPriority.Normal
        objMM.Subject = txtSubject.Text
        objMM.Body = txtMessage.Text

        Dim myClient As New SmtpClient
        myClient.Send(objMM)

        txtSubject.Text = String.Empty
        txtMessage.Text = String.Empty
    End Sub
End Class